#pragma once

#include "Common.h"

class CBat;

class CCamera
{
private:
	float3 m_f3Position;	//position of camera in the world
	float3 m_f3Target;		//point that shows direction for camera

	float m_fFov;			//camera fov

	RECT m_rectViewport;	//viewport on the screen

	bool m_bDynamic;		//set if camera is dynamic and follows bat

	CBat* m_pBatAttached;		//bat to which camera is attached to
public:
	CCamera(CBat* pBat);
	~CCamera(void);

	float3 GetPosition(){ return m_f3Position;}
	void SetPosition(float3 f3Position){ m_f3Position = f3Position;}
	float3 GetTarget(){ return m_f3Target;}
	void SetTarget(float3 f3Target){ m_f3Target = f3Target;}

	float GetFov() {return m_fFov;}
	void SetFov(float fFov){ m_fFov = fFov;}

	RECT GetViewport() {return m_rectViewport;}
	void SetViewport(int iX, int iY, int iWidth, int iHeight);
	float GetAspectRatio() {return ((float)m_rectViewport.right)/((float)m_rectViewport.top);}

	void SetDynamic(bool bEnabled) { m_bDynamic = bEnabled; }
	bool IsDynamic() { return m_bDynamic; }

	int Update();
};
